﻿using StudyDemo.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StudyDemo
{
    [Serializable]
    [StudyDemo.Attributes.Table("xlb_students")]
    public class Student
    {
        [StudyDemo.Attributes.Key]//主键
        public Guid Id { get; set; }

        [StudyDemo.Attributes.Required]
        [StringLength(maximumLength: 50, MinimumLength = 2)]
        public string Name { get; set; }

        [EmailAddress]
        public string Email { get; set; }

        [System.ComponentModel.DataAnnotations.Required]  //不能为空
        public int Age { get; set; }

        [System.ComponentModel.DataAnnotations.Display(Name = "电话号码")]
        public string PhoneNumber { get; set; }

        [StudyDemo.Attributes.Display("性别")]
        public string Sex { get; set; }

        [StudyDemo.Attributes.Display("学号")]
        public string Code { get; set; }

        [StudyDemo.Attributes.Display("班级主键")]
        public string ClassId { get; set; }
    }
}
